﻿@using DCMS.Web.Framework.UI;
@using DCMS.Web.Framework;


@using DCMS.ViewModel.Models.Products;

@model ProductModel

<section id="content_wrapper">
    <!-- Start: Topbar-Dropdown -->
    <div id="topbar-dropmenu">
        @await Html.PartialAsync("_ToolBox")
    </div>
    <!-- End: Topbar-Dropdown -->
    <!-- Start: Topbar -->
    <header id="topbar">
        <div class="topbar-left">
            <ol class="breadcrumb">
                <li class="crumb-active">
                    <a href="#">档案管理</a>
                </li>
                <li class="crumb-icon">
                    <a href="@Url.RouteUrl("HomePage")">
                        <span class="glyphicon glyphicon-home"></span>
                    </a>
                </li>
                <li class="crumb-link">
                    <a href="#">商品管理</a>
                </li>
                <li class="crumb-trail">编辑商品</li>
            </ol>
        </div>
        <div class="topbar-right">
            <div class="ml15 ib va-m" id="toggle_sidemenu_r">
                <a href="#" class="pl5">
                    <i class="fa fa-sign-in fs22 text-primary"></i>
                    <span class="badge badge-hero badge-danger">3</span>
                </a>
            </div>
        </div>
    </header>
    <!-- End: Topbar -->
    <!-- Begin: Content -->
    <section id="content" class="formSection">


        <div class="row">
            <div class="col-md-12">
                <form asp-action="Edit" asp-controller="Product" asp-route-returnurl="@Context.Request.Query["ReturnUrl"]" method="post" class="form-horizontal" id="ProductForm">
                    <div class="panel">
                        <div class="panel-heading">
                            <div class="panel-title">
                                <span class="glyphicon glyphicon-tasks"></span> 编辑商品
                            </div>
                        </div>
                        <div class="panel-body p10 pt10">

                            <div class="tab-block">
                                <ul class="nav nav-tabs tabs-bg">
                                    <li class="active">
                                        <a href="#tab10_1" data-toggle="tab" aria-expanded="true"><i class="fa fa-align-justify text-purple"></i> 基本信息</a>
                                    </li>
                                    <li>
                                        <a href="#tab10_2" data-toggle="tab" aria-expanded="false"><i class="fa fa-shopping-cart text-purple"></i> 其他信息</a>
                                    </li>
                                    <li>
                                        <a href="#tab10_3" data-toggle="tab" aria-expanded="false"><i class="fa fa-coffee text-purple"></i> 口味信息</a>
                                    </li>
                                    <li>
                                        <a href="#tab10_4" data-toggle="tab" aria-expanded="false"><i class="fa fa-rmb text-purple"></i> 价格方案</a>
                                    </li>
                                    <li>
                                        <a href="#tab10_5" data-toggle="tab" aria-expanded="false"><i class="fa fa-random text-purple"></i> 组合商品</a>
                                    </li>
                                </ul>
                                <div class="tab-content">
                                    <div id="tab10_1" class="tab-pane active">
                                        @await Html.PartialAsync("_CreateOrUpdate", Model)
                                    </div>
                                    <div id="tab10_2" class="tab-pane">
                                        @await Html.PartialAsync("_OtherCreateOrUpdate", Model)
                                    </div>
                                    <div id="tab10_3" class="tab-pane">
                                        @await Html.PartialAsync("_FlavorCreateOrUpdate", Model)
                                    </div>
                                    <div id="tab10_4" class="tab-pane">
                                        @await Html.PartialAsync("_ProductTierPrice", Model)
                                    </div>
                                    <div id="tab10_5" class="tab-pane">
                                        @if (Model.CombinationId == 0)
                                        {
                                            <div class="alert alert-danger alert-dismissable">
                                                <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                                                <i class="fa fa-remove pr10"></i> 请先保存属性信息!
                                            </div>
                                        }
                                        else
                                        {
                                            @await Html.PartialAsync("_CombinationProducts", Model)
                                        }
                                    </div>
                                </div>
                            </div>

                        </div>
                        <div class="panel-footer">
                            <div class="form-group mbn">
                                <div class="col-lg-12">
                                    <button class="btn btn-primary" type="submit" id="FormSubmit" value="保存"><i class="fa fa-floppy-o mr5"></i>保存</button>
                                    <button class="btn btn-info" type="submit" id="FormSubmitContinue" name="save-continue" value="保存并编辑"><i class="fa fa-clipboard mr5"></i>保存并编辑</button>
                                    <a class="btn btn-warning" href="@Url.Action("List")"><i class="fa fa-undo mr5"></i> 返回</a>
                                </div>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </section>

    <!-- End: Content -->
</section>



@{
    await Html.RenderPartialAsync("_ModalForm", new ViewDataDictionary(ViewData) { { "formId", "FlavorForm" }, { "modalWindow", "FlavorWindow" }, { "showSave", "true" } });
    await Html.RenderPartialAsync("_ModalForm", new ViewDataDictionary(ViewData) { { "formId", "CombinationForm" }, { "modalWindow", "CombinationWindow" }, { "showSave", "true" } });
    await Html.RenderPartialAsync("_ModalForm", new ViewDataDictionary(ViewData) { { "formId", "BrandForm" }, { "modalWindow", "BrandWindow" }, { "showSave", "true" } });
    await Html.RenderPartialAsync("_ModalForm", new ViewDataDictionary(ViewData) { { "formId", "ManufacturerForm" }, { "modalWindow", "ManufacturerWindow" }, { "showSave", "true" } });
    await Html.RenderPartialAsync("_ModalForm", new ViewDataDictionary(ViewData) { { "formId", "ProductModalForm" }, { "modalWindow", "ModalProductWindows" }, { "windowWidth", "1000px" }, { "showSave", "true" } });
}


@section CurPageScripts
{
  
    @await Html.PartialAsync("_Scripts", Model)
}

